ValidateExpiration

SoftwareShield ClientProtector COM Component > ClientProtector (SSCProtector) Reference > ValidateExpiration

## ValidateExpiration

The ValidateExpiration function checks if the license is in expire mode, and if so, performs a series of checks on the validity of the expiration state as well as updating key expiration fields in the license.

###### Syntax

HRESULT ValidateExpiration ( long * return_code );

###### Parameters

return_code

[OUT] This is (a pointer to) a numeric value that returns with a RETURNCODE that identifies the outcome of the operation. (See remarks section below for details.)

###### Remarks

Note: This function is illustrated in the SoftwareShield Flowcharts - (see flow chart #5).

The ValidateExpiration function checks if the license is in expire mode, and if so, performs a series of checks on the validity of the expiration state as well as updating key expiration fields in the license.

If the license has not been initialized successfully with a call to StartUp, the function will return with return_code holding FALSE_LICENSE_NOT_INITIALIZED.

If the license is not in expire mode (not under the influence of any kind of expiration), then the licenses Last Used Date and Time field is updated and the function returns with the return_code holding TRUE_NON_EXPIRY.

If the license is in expire mode (under the influence of any kind of expiration), then the license is checked to see if it has expired. If it has, the Last Used Date and Time field is updated and the function returns with the return_code holding FALSE_LICENSE_EXPIRED.

If the license is in expire mode (under the influence of any kind of expiration), then the license is checked to see if it has expired. If it has not expired, the Clock Roll-Back detection feature is executed. If the clock has been rolled back the function returns with the return_code holding FALSE_CLOCK_TURNED_BACK.

If the license is in expire mode (under the influence of any kind of expiration), then the license is checked to see if it has expired. If it has not expired and the clock has not been rolled back, the Last Used Date and Time is updated and the function returns with the return_code holding TRUE_EXPIRY.

This function can be useful when using an expire mode license and you wish to do a periodic check to ensure that during execution the user has not rolled back the clock, or if your software typically runs for a long period of time that the expiration has not lapsed.

###### Return Value

As with all COM function calls they return an HRESULT. HRESULT is a data type that is a 32-bit error or warning code. Check your compilers documentation for information on interpreting the HRESULT value.

###### Function Information

Exposed By Interface: | "ISSCProtector"
Exposed In COM Server Binaries: | "SSCProt.dll" and "SSCProtD.dll"